﻿using Application.DTO.Department;
using Application.DTO.Dictionary;
using Application.DTO.Form;
using Application.DTO.Permission;
using Application.DTO.Role;
using Application.DTO.User;
using AutoMapper;
using Domain.Entity.Department;
using Domain.Entity.Dictionary;
using Domain.Entity.Form;
using Domain.Entity.Permission;
using Domain.Entity.Role;
using Domain.Entity.User;
using System.IO;

namespace ApiServer.Automappers
{
    public class ConvertObj : Profile
    {
        public ConvertObj()
        {
            //示例：从dome1转换成dome2
            //CreateMap<dome1, dome2>();

            //用户
            CreateMap<UserInfo, LoginSuccessResponseDTO>();
            CreateMap<RegisterAmountRequestDTO, UserInfo>();
            CreateMap<UserEditDTO, UserInfo>();

            //角色
            CreateMap<RoleAddRequestDTO, RoleInfo>();
            CreateMap<RoleUpdateRequestDTO, RoleInfo>();
            CreateMap<RoleInfo,RoleReturnDTO>();

            //部门
            CreateMap<DepartmentFormDTO, Departments>();

            //权限
            CreateMap<PermissionAddDto, PermissionInfo>();
            //CreateMap<PermissionInfo, MenuDTO>();

            //表单
            CreateMap<FormDesignerDTO, FormDesignInfo>();
            
            //字典
            CreateMap<DictionaryListFormDTO, DictionaryKey>().ReverseMap();
            CreateMap<DictionaryValue, DictionaryValuesDTO>();
            CreateMap<DictionaryValuesDTO, DictionaryValue>();
            CreateMap<DictionaryKey, DictionaryKeyShowDTO>();
        }
    }
}
